package jman.jdbc.jan14;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class BaseDao {
	String driver="com.mysql.jdbc.Driver";
	String database="java3";
	String userName="root";
	String pwd="gzy411527";
	String url="jdbc:mysql://localhost:3306/"+database+"??useUnicode=true&characterEncoding=utf-8";
	Connection con=null;
	public  Connection getCon() {
		try {
			Class.forName(driver);
		    con=DriverManager.getConnection(url, userName, pwd);
		} catch (ClassNotFoundException | SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return con;
	}
}
